<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/10/28
 * Time: 18:56
 */

return [
    "lists"=>"select distinct a.id,name,SUBSTR(info,1,50) as info,price,img from shop.goods,(select id,price from shop.repo) a
                WHERE a.id  =  shop.goods.id
                order by a.id 
                limit ?,10"
    ,"get_info"=>"select distinct a.id,name,info,price,img from shop.goods,(select id,price from shop.repo) a
WHERE a.id  =  shop.goods.id and a.id = ? ",
    "addgood"=>"INSERT INTO shop.goods(id,name,info,img) VALUES(?,?,?,?);",
    "addrepo"=>"INSERT INTO shop.repo(id,num,price) VALUES(?,?,?)",
    "MAXID"=>"SELECT MAX(id) FROM shop.goods",
    "SAVECAR"=>"INSERT INTO shop.car(uid,id,num) VALUES(?,?,?)",
    "BUY_SELECT"=>"INSERT INTO shop.buy(uid,id,num) VALUES(?,?,?)",
    "updategood"=>"UPDATE shop.goods set name=?,info = ? WHERE id = ?",
    "updaterepo"=>"UPDATE shop.repo set price = ?,num = ? WHERE id = ?"
];